﻿/*
Copyright © 2010 François Karman

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

See <license.txt> for the complete license of the software.
*/

using System;

namespace Ghost.Tasks.Hg
{
    /// <summary>
    /// Defines a property as a command parameter.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
    public sealed class ParameterAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the ParameterAttribute class.
        /// </summary>
        /// <param name="prefix">
        /// The prefix used for the command parameter.
        /// </param>
        public ParameterAttribute(string prefix)
        {
            this.Prefix = prefix;
        }

        /// <summary>
        /// Gets the prefix of the command parameter.
        /// </summary>
        /// <remarks>
        /// If <c>null</c> or empty, the associated parameter is considered
        /// as the default one. A such parameter should be unique for a
        /// command and will always be placed at the end of the generated
        /// command.
        /// </remarks>
        public string Prefix { get; private set; }
    }
}
